package me.zhanghai.ohos.materialratingbar.vector;

import ohos.agp.components.element.Element;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.utils.Rect;

abstract class VectorDrawableCommon extends ShapeElement {

    // Drawable delegation for supported API levels.
    Element mDelegateDrawable;

//    public void createNativePtr(Object obj){
//
//    }

    @Override
    public void setBounds(Rect bounds) {
        if (mDelegateDrawable != null) {
            mDelegateDrawable.setBounds(bounds);
            return;
        }
        super.setBounds(bounds);
    }

    @Override
    public Element getCurrentElement() {
        if (mDelegateDrawable != null) {
            return mDelegateDrawable.getCurrentElement();
        }
        return super.getCurrentElement();
    }

    @Override
    public int getMinWidth() {
        if (mDelegateDrawable != null) {
            return mDelegateDrawable.getMinWidth();
        }
        return super.getMinWidth();
    }

    @Override
    public int getMinHeight() {
        if (mDelegateDrawable != null) {
            return mDelegateDrawable.getMinHeight();
        }
        return super.getMinHeight();
    }


}
